/**
 * Created by sunliang on 2017/4/18.
 */
Ext.define('Admin.view.baseInfo.waterQualityInfo',{
  extend:'Ext.container.Container',
  xtype:'waterQualityInfo',
  require:[],
  user:[],
  // controller: 'riverBaseController',
  userCLs:'big-100 small-100',
  layout:'fit',
  items:{
    xtype:'panel',
    layout:'anchor',
    cls:'dashboard-main-chart shadow',
    width:'100%',
    minHeight:760,
    margin:15,
    bodyPadding:15,
    items:[
      {
        xtype:'grid',
        title:'水质信息',
        height:'100%',
        border:true,
        margin:'0 0 15 0',
        bind:{
          store:'waterQualityInfo'
        },
        reference: 'historyGrid',//添加“reference”配置到表格并用lookupReference方法获取表格组件
        stripeRows:true,//斑马纹效果
        loadMask:true,//loading效果
        multiSelect:false//允许用户在列表中同时选择多个
      },{
        tbar: [{
          xtype: "textfield",
          maxWidth: 220,
          fieldLabel: "测站名称",
          labelWidth: 60,
          reference: "newproNm"
        },
        {
          xtype: "button",
          text: "查询",
          iconCls: 'x-fa  fa-file-o',
          handler: 'check',
          margin:'0 10 0 580',
          // buttoncolor:'#108ee9',
          //  style: 'background-color:#108ee9; border-radius:4px;-webkit-border-radius: 4px;',
          style: 'border-radius:4px;-webkit-border-radius: 4px;'
        },
        {
          xtype: "button",
          text: "新增",
          iconCls: 'x-fa  fa-file-o',
          handler: 'add',
          // style: 'background-color:#05dd05; border-radius:4px;-webkit-border-radius: 4px;',
          style: 'border-radius:4px;-webkit-border-radius: 4px;'
        },{
          xtype: "button",
          text: "导入",
          iconCls: 'x-fa  fa-file-o',
          handler: 'input',
          // style: 'background-color:#eb9316; border-radius:4px;-webkit-border-radius: 4px;',
          style: 'border-radius:4px;-webkit-border-radius: 4px;'
        },{
          xtype: "button",
          text: "导出",
          iconCls: 'x-fa  fa-file-o',
          handler: 'output',
          // style: 'background-color:#337ab7; border-radius:4px;-webkit-border-radius: 4px;',
          style: 'border-radius:4px;-webkit-border-radius: 4px;'
        }],
        margin:'0 0 10 0'
      },{
        region: 'center',
        itemId: 'card',
        width: '100%',
        layout: 'card',
        items:[{
          extend:'Ext.tab.Panel',
          // xtype;'riverBaseInfoChild',
          //xtype: 'layout-cardtabs',

          border:true,
          style: 'background-color:#dfe8f6; ',
          items:{
            // title: '测站名称',
            xtype:'grid',
            columns: [
              {header: '测站编号', dataIndex: 'id',/** editor: 'textfield' ,*/align:'center',width:'10%'},
              {header: '测站名称', dataIndex: 'name',/** editor: 'textfield' ,*/align:'center',width:'10%'},
              {header: '流域名称', dataIndex: 'riverBasin', /** editor: 'textfield' ,*/align:'center',width:'10%'},
              {header: '水系名称', dataIndex: 'riverSystem', /** editor: 'textfield' ,*/align:'center',width:'10%'},
              {header: '河流名称', dataIndex: 'riverName', /** editor: 'textfield' ,*/align:'center',width:'10%'},
              {header: '经度', dataIndex: 'longitude', /** editor: 'textfield' ,*/align:'center',width:'10%'},
              {header: '纬度', dataIndex: 'latitude', /** editor: 'textfield' ,*/align:'center',width:'10%'},
              {header: '站址', dataIndex: 'address', /** editor: 'textfield' ,*/align:'center',width:'15%'},
              {header: '操作', dataIndex: 'operate', /** editor: 'textfield' ,*/align:'center',xtype : 'actioncolumn',width:'14.5%',
                // renderer:function(value,cellmeta){
                //   var returnStr = "<INPUT type='button' value='修改' style='width:60px;' onclick=btnAction()"> " + "<INPUT type='button' value='删除' style='width:60px;margin-left:2px;'>";
                //   return returnStr;
                // }
                items:[
                  {xtype:'button',
                   text:'修改',
                   iconCls: "x-fa fa-search",
                   style: 'border-radius:4px;-webkit-border-radius: 4px;',
                   handler: 'update'
                  },{xtype:'button',
                   text:'删除',
                   iconCls: "x-fa fa-search",
                   style: 'border-radius:4px;-webkit-border-radius: 4px;',
                   handler: 'delete'
                  }]
              }
           ],
           stripeRows: true,
           columnLines: true,
          //  forceFit: true, //表格自适应
           store: {
             fields:[ 'id', 'name', 'riverBasin', 'riverSystem','riverName','longitude','latitude','address','operate'],
             data: [
               { id: '62421100', name: '河东大桥', riverBasin: '长江',riverSystem:'抚河',riverName:'盱江',longitude:'116',latitude:'27',address:'广昌县盱江镇河东大桥' },
               { id: '62421101', name: '南丰南门', riverBasin: '长江',riverSystem:'抚河',riverName:'盱江',longitude:'117',latitude:'27',address:'南丰县琴城镇南门' },
               { id: '62421102', name: '南丰大桥', riverBasin: '长江',riverSystem:'抚河',riverName:'盱江',longitude:'117',latitude:'27',address:'南丰县琴城镇南丰大桥' },
               { id: '62421103', name: '太平桥', riverBasin: '长江',riverSystem:'抚河',riverName:'盱江',longitude:'117',latitude:'28',address:'南城县建昌镇太平桥' },
               { id: '62421104', name: '文昌桥上', riverBasin: '长江',riverSystem:'抚河',riverName:'抚河',longitude:'116',latitude:'28',address:'抚州市上沿河路' },
               { id: '62421105', name: '文昌桥上', riverBasin: '长江',riverSystem:'抚河',riverName:'抚河',longitude:'116',latitude:'28',address:'抚州市下沿河路' },
               { id: '62421106', name: '南区水厂', riverBasin: '长江',riverSystem:'抚河',riverName:'抚河',longitude:'116',latitude:'28',address:'抚州市南区水厂上100米' },
               { id: '62421107', name: '荆公路水厂', riverBasin: '长江',riverSystem:'抚河',riverName:'抚河',longitude:'116',latitude:'28',address:'抚州市荆公水厂上50米' },
               { id: '62421108', name: '钟岭水厂', riverBasin: '长江',riverSystem:'抚河',riverName:'抚河',longitude:'116',latitude:'28',address:'抚州市钟岭水厂上50米' },
               { id: '62421109', name: '新丰桥', riverBasin: '长江',riverSystem:'抚河',riverName:'黎滩河',longitude:'117',latitude:'27',address:'黎川县日峰镇新丰桥' }
             ]
           },
           plugins: {
             ptype: 'cellediting',
             clicksToEdit: 1
           }
         }
        }]
      },{
        bbar: new Ext.PagingToolbar({
          pageSize:10,
          displayInfo:false,
          store:this.store,
          // emptyMsg:'无数据',
          margin:'10 0 0 800'
        })
      }
    ]
  }
})
